// 修改指令为Vue 3格式
export default {
    mounted(el) {
        el.style.position = 'relative';
        el.style.overflow = 'hidden';
        el.addEventListener('click', (e) => {
            const ripple = document.createElement('div');
            const rect = el.getBoundingClientRect();
            const size = Math.max(rect.width, rect.height);
            // 简化波纹生成逻辑
            ripple.style.cssText = `
                width: ${size}px;
                height: ${size}px;
                left: ${e.clientX - rect.left - size/2}px;
                top: ${e.clientY - rect.top - size/2}px;
                position: absolute;
                border-radius: 50%;
                background: rgba(0, 0, 0, 0.15);
                animation: waves 0.6s linear;
            `;
            el.appendChild(ripple);
            setTimeout(() => ripple.remove(), 600);
        });
    }
}